package com.example.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    private Long id;

    @NotBlank(message = "用户名不能为空")
    private String username;

    @JsonIgnore//不参与JSON序列化
    @NotBlank(message = "密码不能为空")
    private String password;

    @NotBlank(message = "昵称不能为空")
    private String nickname;

    @NotBlank(message = "电话不能为空")
    private String phoneNum;

    @NotBlank(message = "邮箱不能为空")
    private String email;

    private Byte gender;
    @JsonIgnore
    private String salt;

    @JsonInclude(JsonInclude.Include.ALWAYS)
    private String avatarUrl;

    private Integer articleCount;

    private Byte isAdmin;

    private String remark;

    private Byte state;
    @JsonIgnore
    private Byte deleteState;

    private Date createTime;

    private Date updateTime;
}